3.5.22 \(\int (g+h x) (a+b \log (c (d (e+f x)^p)^q)) \, dx\) [422]

Optimal. Leaf size=98 \[ -\frac {b (f g-e h) p q x}{2 f}-\frac {b p q (g+h x)^2}{4 h}-\frac {b (f g-e h)^2 p q \log (e+f x)}{2 f^2 h}+\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h} \]

[Out]

-1/2*b*(-e*h+f*g)*p*q*x/f-1/4*b*p*q*(h*x+g)^2/h-1/2*b*(-e*h+f*g)^2*p*q*ln(f*x+e)/f^2/h+1/2*(h*x+g)^2*(a+b*ln(c
*(d*(f*x+e)^p)^q))/h

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2442, 45, 2495} \begin {gather*} \frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\frac {b p q (f g-e h)^2 \log (e+f x)}{2 f^2 h}-\frac {b p q x (f g-e h)}{2 f}-\frac {b p q (g+h x)^2}{4 h} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(g + h*x)*(a + b*Log[c*(d*(e + f*x)^p)^q]),x]

[Out]

-1/2*(b*(f*g - e*h)*p*q*x)/f - (b*p*q*(g + h*x)^2)/(4*h) - (b*(f*g - e*h)^2*p*q*Log[e + f*x])/(2*f^2*h) + ((g
+ h*x)^2*(a + b*Log[c*(d*(e + f*x)^p)^q]))/(2*h)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2495

Int[((a_.) + Log[(c_.)*((d_.)*((e_.) + (f_.)*(x_))^(m_.))^(n_)]*(b_.))^(p_.)*(u_.), x_Symbol] :> Subst[Int[u*(
a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x], c*d^n*(e + f*x)^(m*n), c*(d*(e + f*x)^m)^n] /; FreeQ[{a, b, c, d, e,
f, m, n, p}, x] &&  !IntegerQ[n] &&  !(EqQ[d, 1] && EqQ[m, 1]) && IntegralFreeQ[IntHide[u*(a + b*Log[c*d^n*(e
+ f*x)^(m*n)])^p, x]]

Rubi steps

\begin {align*} \int (g+h x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx &=\text {Subst}\left (\int (g+h x) \left (a+b \log \left (c d^q (e+f x)^{p q}\right )\right ) \, dx,c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\text {Subst}\left (\frac {(b f p q) \int \frac {(g+h x)^2}{e+f x} \, dx}{2 h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\text {Subst}\left (\frac {(b f p q) \int \left (\frac {h (f g-e h)}{f^2}+\frac {(f g-e h)^2}{f^2 (e+f x)}+\frac {h (g+h x)}{f}\right ) \, dx}{2 h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=-\frac {b (f g-e h) p q x}{2 f}-\frac {b p q (g+h x)^2}{4 h}-\frac {b (f g-e h)^2 p q \log (e+f x)}{2 f^2 h}+\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 113, normalized size = 1.15 \begin {gather*} a g x-b g p q x+\frac {b e h p q x}{2 f}+\frac {1}{2} a h x^2-\frac {1}{4} b h p q x^2-\frac {b e^2 h p q \log (e+f x)}{2 f^2}+\frac {1}{2} b h x^2 \log \left (c \left (d (e+f x)^p\right )^q\right )+\frac {b g (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(g + h*x)*(a + b*Log[c*(d*(e + f*x)^p)^q]),x]

[Out]

a*g*x - b*g*p*q*x + (b*e*h*p*q*x)/(2*f) + (a*h*x^2)/2 - (b*h*p*q*x^2)/4 - (b*e^2*h*p*q*Log[e + f*x])/(2*f^2) +
 (b*h*x^2*Log[c*(d*(e + f*x)^p)^q])/2 + (b*g*(e + f*x)*Log[c*(d*(e + f*x)^p)^q])/f

________________________________________________________________________________________

Maple [F]
time = 0.05, size = 0, normalized size = 0.00 \[\int \left (h x +g \right ) \left (a +b \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)*(a+b*ln(c*(d*(f*x+e)^p)^q)),x)

[Out]

int((h*x+g)*(a+b*ln(c*(d*(f*x+e)^p)^q)),x)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 117, normalized size = 1.19 \begin {gather*} -b f g p q {\left (\frac {x}{f} - \frac {e \log \left (f x + e\right )}{f^{2}}\right )} - \frac {1}{4} \, b f h p q {\left (\frac {f x^{2} - 2 \, x e}{f^{2}} + \frac {2 \, e^{2} \log \left (f x + e\right )}{f^{3}}\right )} + \frac {1}{2} \, b h x^{2} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + \frac {1}{2} \, a h x^{2} + b g x \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a g x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="maxima")

[Out]

-b*f*g*p*q*(x/f - e*log(f*x + e)/f^2) - 1/4*b*f*h*p*q*((f*x^2 - 2*x*e)/f^2 + 2*e^2*log(f*x + e)/f^3) + 1/2*b*h
*x^2*log(((f*x + e)^p*d)^q*c) + 1/2*a*h*x^2 + b*g*x*log(((f*x + e)^p*d)^q*c) + a*g*x

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 150, normalized size = 1.53 \begin {gather*} \frac {2 \, b f h p q x e - {\left (b f^{2} h p q - 2 \, a f^{2} h\right )} x^{2} - 4 \, {\left (b f^{2} g p q - a f^{2} g\right )} x + 2 \, {\left (b f^{2} h p q x^{2} + 2 \, b f^{2} g p q x + 2 \, b f g p q e - b h p q e^{2}\right )} \log \left (f x + e\right ) + 2 \, {\left (b f^{2} h x^{2} + 2 \, b f^{2} g x\right )} \log \left (c\right ) + 2 \, {\left (b f^{2} h q x^{2} + 2 \, b f^{2} g q x\right )} \log \left (d\right )}{4 \, f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="fricas")

[Out]

1/4*(2*b*f*h*p*q*x*e - (b*f^2*h*p*q - 2*a*f^2*h)*x^2 - 4*(b*f^2*g*p*q - a*f^2*g)*x + 2*(b*f^2*h*p*q*x^2 + 2*b*
f^2*g*p*q*x + 2*b*f*g*p*q*e - b*h*p*q*e^2)*log(f*x + e) + 2*(b*f^2*h*x^2 + 2*b*f^2*g*x)*log(c) + 2*(b*f^2*h*q*
x^2 + 2*b*f^2*g*q*x)*log(d))/f^2

________________________________________________________________________________________

Sympy [A]
time = 0.61, size = 156, normalized size = 1.59 \begin {gather*} \begin {cases} a g x + \frac {a h x^{2}}{2} - \frac {b e^{2} h \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2 f^{2}} + \frac {b e g \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} + \frac {b e h p q x}{2 f} - b g p q x + b g x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} - \frac {b h p q x^{2}}{4} + \frac {b h x^{2} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2} & \text {for}\: f \neq 0 \\\left (a + b \log {\left (c \left (d e^{p}\right )^{q} \right )}\right ) \left (g x + \frac {h x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(a+b*ln(c*(d*(f*x+e)**p)**q)),x)

[Out]

Piecewise((a*g*x + a*h*x**2/2 - b*e**2*h*log(c*(d*(e + f*x)**p)**q)/(2*f**2) + b*e*g*log(c*(d*(e + f*x)**p)**q
)/f + b*e*h*p*q*x/(2*f) - b*g*p*q*x + b*g*x*log(c*(d*(e + f*x)**p)**q) - b*h*p*q*x**2/4 + b*h*x**2*log(c*(d*(e
 + f*x)**p)**q)/2, Ne(f, 0)), ((a + b*log(c*(d*e**p)**q))*(g*x + h*x**2/2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs. \(2 (94) = 188\).
time = 4.94, size = 259, normalized size = 2.64 \begin {gather*} \frac {{\left (f x + e\right )} b g p q \log \left (f x + e\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h p q \log \left (f x + e\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h p q e \log \left (f x + e\right )}{f^{2}} - \frac {{\left (f x + e\right )} b g p q}{f} - \frac {{\left (f x + e\right )}^{2} b h p q}{4 \, f^{2}} + \frac {{\left (f x + e\right )} b h p q e}{f^{2}} + \frac {{\left (f x + e\right )} b g q \log \left (d\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h q \log \left (d\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h q e \log \left (d\right )}{f^{2}} + \frac {{\left (f x + e\right )} b g \log \left (c\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h \log \left (c\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h e \log \left (c\right )}{f^{2}} + \frac {{\left (f x + e\right )} a g}{f} + \frac {{\left (f x + e\right )}^{2} a h}{2 \, f^{2}} - \frac {{\left (f x + e\right )} a h e}{f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="giac")

[Out]

(f*x + e)*b*g*p*q*log(f*x + e)/f + 1/2*(f*x + e)^2*b*h*p*q*log(f*x + e)/f^2 - (f*x + e)*b*h*p*q*e*log(f*x + e)
/f^2 - (f*x + e)*b*g*p*q/f - 1/4*(f*x + e)^2*b*h*p*q/f^2 + (f*x + e)*b*h*p*q*e/f^2 + (f*x + e)*b*g*q*log(d)/f
+ 1/2*(f*x + e)^2*b*h*q*log(d)/f^2 - (f*x + e)*b*h*q*e*log(d)/f^2 + (f*x + e)*b*g*log(c)/f + 1/2*(f*x + e)^2*b
*h*log(c)/f^2 - (f*x + e)*b*h*e*log(c)/f^2 + (f*x + e)*a*g/f + 1/2*(f*x + e)^2*a*h/f^2 - (f*x + e)*a*h*e/f^2

________________________________________________________________________________________

Mupad [B]
time = 0.29, size = 113, normalized size = 1.15 \begin {gather*} \ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )\,\left (\frac {b\,h\,x^2}{2}+b\,g\,x\right )+x\,\left (\frac {2\,a\,e\,h+2\,a\,f\,g-2\,b\,f\,g\,p\,q}{2\,f}-\frac {e\,h\,\left (2\,a-b\,p\,q\right )}{2\,f}\right )+\frac {h\,x^2\,\left (2\,a-b\,p\,q\right )}{4}-\frac {\ln \left (e+f\,x\right )\,\left (b\,e^2\,h\,p\,q-2\,b\,e\,f\,g\,p\,q\right )}{2\,f^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g + h*x)*(a + b*log(c*(d*(e + f*x)^p)^q)),x)

[Out]

log(c*(d*(e + f*x)^p)^q)*((b*h*x^2)/2 + b*g*x) + x*((2*a*e*h + 2*a*f*g - 2*b*f*g*p*q)/(2*f) - (e*h*(2*a - b*p*
q))/(2*f)) + (h*x^2*(2*a - b*p*q))/4 - (log(e + f*x)*(b*e^2*h*p*q - 2*b*e*f*g*p*q))/(2*f^2)

________________________________________________________________________________________